var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2BundleManager = require("BundleManager");
var $2DataManager = require("DataManager");
var $2PlantMgr = require("PlantMgr");
var $2UIManager = require("UIManager");
var $2UserDataManager = require("UserDataManager");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_UnLockPlantUI = /* */function (_cc$Component78) {
  babel_inherits(h, _cc$Component78);
  var _super94 = babel_createSuper(h);
  function h() {
    var _this216;
    babel_classCallCheck(this, h);
    _this216 = _super94.apply(this, arguments);
    _this216.plantIcon = null;
    _this216.plantName = null;
    _this216.rare = null;
    _this216.rareName = ["普通", "稀有", "稀有", "史诗", "传说"];
    return _this216;
  }
  babel_createClass(h, [{
    key: "onLoad",
    value: function onLoad() {
      var e = $2PlantMgr.default.instance().getPlant($2DataManager.default.instance.lockPlant);
      var t = $2PlantMgr.default.instance().getPlant($2DataManager.default.instance.lockPlant).rare;
      this.plantIcon.skeletonData = $2BundleManager.default.instance.getBundleRes("Spine", "plant/" + e.dragonName + "/" + e.dragonName, sp.SkeletonData);
      console.log("====> 获得新植物:", e.dragonName, e.skinName);
      e.skinName && this.plantIcon.setSkin(e.skinName);
      this.plantIcon.setAnimation(0, "daiji", true);
      this.plantName.string = e.name;
      this.rare.string = this.rareName[t - 1];
    }
  }, {
    key: "onClickClose",
    value: function onClickClose() {
      $2DataManager.default.instance.lockPlant = 0;
      $2UserDataManager.default.instance.upGradeGuide || $2UIManager.default.instance.openUI("GuideUI2", 99).emit("init", 2);
      $2UIManager.default.instance.closeUI("UnLockPlantUI");
    }
  }]);
  return h;
}(cc.Component);
cc__decorate([ccp_property(sp.Skeleton)], def_UnLockPlantUI.prototype, "plantIcon", undefined);
cc__decorate([ccp_property(cc.Label)], def_UnLockPlantUI.prototype, "plantName", undefined);
cc__decorate([ccp_property(cc.Label)], def_UnLockPlantUI.prototype, "rare", undefined);
def_UnLockPlantUI = cc__decorate([ccp_ccclass], def_UnLockPlantUI);
exports.default = def_UnLockPlantUI;